﻿<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="Equipment.Business" %>
<%@ Import Namespace="Equipment.DataAccess" %>
<%  Dim un As Equipment.DataAccess.UserNotification = DirectCast(ViewData("currNotification"), Equipment.DataAccess.UserNotification)%>
<table>
    <tr>
        <td width="50px" rowspan="2">
            <img border="0" src="../../Content/img/email-notification.png" width="40" height="40">
        </td>
        <td width="130px">
            <label for="Id">
                Notification Name:</label>
        </td>
        <td width="280px">
            <%= un.Description%>
        </td>
        <td>
        </td>
    </tr>
    <tr>

        <td class="top">
            <label for="Id">
                Trigger:</label>
        </td>
        <td class="top">
            <%= NotificationTriggerLookup.GetDescriptionByType(un.NotificationTrigger)%>
        </td>
    </tr>
    <% If un.NotificationTrigger = NotificationTrigger.WorkOrder_Overdue_ByDay Or un.NotificationTrigger = NotificationTrigger.WorkOrder_Overdue_ByHour Then%>
    <tr>
        <td width="50px">
            <img border="0" src="../../Content/img/clock.jpg" width="40" height="40">
        </td>
        <td class="top">
            <label for="Id">
                Overdue:</label>
        </td>
        <td class="top">
            <%= String.Format(NotificationOverdueLookup.GetDescriptionTemplateByType(un.OverdueType, un.NotificationTrigger), un.OverdueXValue)%>
        </td>
    </tr>
    <% End If%>
    <tr>
        <td width="50px" rowspan="2">
            <img border="0" src="../../Content/img/asset-department.jpg" width="40" height="40">
        </td>
        <td class="top">
            <label for="Id">
                Site Department:</label>
        </td>
        <td class="top">
            <%= un.SiteDepartment.Description %>
        </td>

    </tr>
    <% If un.AssetTypeID.HasValue Then%>
    <tr>
        <td class="top">
            <label for="Id">
                Asset Type:</label>
        </td>
        <td class="top">
             <%= un.AssetType.Description%>
        </td>

    </tr>
    <% End If%>
    <tr>
        <td class="top" colspan="2">
            <span id="errMsg" class="err"></span>
        </td>
    </tr>
    <tr>
        <td width="50px">
            <input type="submit" class="button left" value="<< Back" onclick="toDepartmentStep(); return false;" />
        </td>
        <td>
            <input type="submit" class="button right" value="       Save       " onclick="save(); return false;" />            
        </td>
    </tr>
</table>
